/**
 * Created by raphael on 15-9-9.
 */
var ldap = require('ldapjs');
var client = ldap.createClient({
    url: 'ldap://127.0.0.1:1389'
});

client.bind('cn=root', '', function(err){
    assert.ifError(err);
});

var entry = {
    cn: 'foo',
    sn: 'bar',
    email: ['foo@bar.com', 'foo1@bar.com'],
    objectclass: 'fooPerson'
};

client.add('cn=foo, o=example', entry, function(err) {
    assert.ifError(err);
});

client.compare('cn=foo, o=example', 'sn', 'bar', function(err, matched) {
    assert.ifError(err);

    console.log('matched: ' + matched);
});

